﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;
using ProjetoJornada_Negocios.Fachada;
using Basicas;

namespace ProjetoJornada.Externo
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Session.Clear();

        }

        protected void ButtonEntrar_Click(object sender, EventArgs e)
        {
            string login = this.LoginTextBox.Text;
            string senha = this.SenhaTextBox.Text;

            if (login == "admin" && senha == "admin")
            {

                FormsAuthentication.RedirectFromLoginPage("admin", false);
                Response.Redirect(@"\Interno\Jornada_Escolher.aspx");

                /*Fachada fachada = Fachada.Instance;
                List<Jornada> jornadas = fachada.ConsultarTodasJornadas();

                Boolean achou = false;
                int i = 0;

                while(i < jornadas.Count)
                {
                    if (jornadas[i])
                    { 
                    
                    }
                    
                    i++;
                }*/

            }
            else
            {
                this.LabelMsg.Text = "Login e/ou senha inválido (s)";
                this.LabelMsg.Visible = true;
            }
        }
    }
}
